﻿using ServoDrivesLib.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ServoDrivesLib.Device
{
    public class GoogolTechControl : CIA402DeviceControl
    {
        public GoogolTechControl(CardControl? servo, int axisId) : base(servo)
        {
            AxisId = axisId;
        }

        public override int CloseCia402()
        {
            base.Enable(false);
            Thread.Sleep(1000);
            base.servo.SDOWrite(AxisId, 0x2016, 0, 2,0b0011_0000);
            return 1;
        }

        public override int OpenCia402()
        {
            base.Enable(false);
            Thread.Sleep(1000);
            base.servo.SDOWrite(AxisId, 0x2016, 0, 2, 0b0001_0000);
            return 1;
        }
    }
}
